<?php $this->fetch('public/head') ?>
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class=""><a href="<?php echo url('index') ?>">信息列表</a></li>
        <li class="<?php echo $rows['id']?'':'layui-this' ?>"><a href="<?php echo url('edit') ?>">添加信息</a></li>
        <?php if($rows['id']): ?><li class="layui-this">编辑信息</li><?php endif; ?>
    </ul>
    <?php language_tab();//多语言tab ?>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form" action="<?php echo url('save') ?>" method="post">
                <div class=" layui-form-item">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-block">
                        <select name="nid">
                            <?php foreach($navcat_list as $k=>$v): ?>
                                <option value="<?php echo $k ?>" <?php if($rows['nid']==$k){echo 'selected="selected"';} ?>><?php echo $v ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>
                <div class="list_0 layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title_cn" value="<?php echo $rows['title_cn'] ?>" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="list_1 layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title_en" value="<?php echo $rows['title_en'] ?>" autocomplete="off" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">外链</label>
                    <div class="layui-input-block">
                        <input type="text" name="link" value="<?php echo $rows['link'] ?>" placeholder="外部链接，不需时勿填写" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="list_0 layui-form-item">
                    <label class="layui-form-label">图片</label>
                    <div class="layui-upload">
                        <input type="text" name="img_url_cn" value="<?php echo $rows['img_url_cn'] ?>" class="layui-input layui-input-inline">
                        <button type="button" class="layui-btn _img_url" lay-data="{data:{max_width:600,max_height:400,path:'listinfo'}}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                        <img src="<?php echo $rows['img_url_cn'] ?>" height="38" data-expander=''>
                        仅允许上传jpg,png,gif,jpeg格式，推荐尺寸600*400
                    </div>
                </div>
                <div class="list_1 layui-form-item">
                    <label class="layui-form-label">图片</label>
                    <div class="layui-upload">
                        <input type="text" name="img_url_en" value="<?php echo $rows['img_url_en'] ?>" class="layui-input layui-input-inline">
                        <button type="button" class="layui-btn _img_url" lay-data="{data:{max_width:600,max_height:400,path:'listinfo'}}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                        <img src="<?php echo $rows['img_url_en'] ?>" height="38" data-expander=''>
                        仅允许上传jpg,png,gif,jpeg格式，推荐尺寸600*400
                        <a class="layui-btn layui-btn-primary layui-btn-radius" onclick="copy_img('img_url_cn',this)">选取中文图片</a>
                    </div>
                </div>
                <div class="list_0 layui-form-item">
                    <label class="layui-form-label">摘要</label>
                    <div class="layui-input-block">
                        <textarea name="zhaiyao_cn" class="layui-textarea"><?php echo $rows['zhaiyao_cn'] ?></textarea>
                    </div>
                </div>
                <div class="list_1 layui-form-item">
                    <label class="layui-form-label">摘要</label>
                    <div class="layui-input-block">
                        <textarea name="zhaiyao_en" class="layui-textarea"><?php echo $rows['zhaiyao_en'] ?></textarea>
                    </div>
                </div>
                <div class="list_0 layui-form-item">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <textarea id="editor" name="content_cn" class="layui-textarea" style="height: 200px;"><?php echo $rows['content_cn'] ?></textarea>
                    </div>
                </div>
                <div class="list_1 layui-form-item">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <textarea id="editor2" name="content_en" class="layui-textarea" style="height: 200px;"><?php echo $rows['content_en'] ?></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">置顶</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_top" value="1" title="显示" <?php if($rows['is_top']==1){echo 'checked="checked"';} ?>>
                        <input type="radio" name="is_top" value="0" title="隐藏" <?php if($rows['is_top']===0 || !$rows['id']){echo 'checked="checked"';} ?>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_show" value="1" title="显示" <?php if($rows['is_show']==1 || !$rows['id']){echo 'checked="checked"';} ?>>
                        <input type="radio" name="is_show" value="0" title="隐藏" <?php if($rows['is_show']===0){echo 'checked="checked"';} ?>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text" name="sort" value="<?php echo $rows['sort']?:0 ?>" lay-verify="required|number" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发布时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="add_time" value="<?php echo $rows['add_time']?:date('Y-m-d H:i:s') ?>" lay-verify="datetime" class="layui-input datetime">
                    </div>
                </div>
                <input type="hidden" name="id" value="<?php echo $rows['id'] ?>">
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $this->fetch('public/script') ?>